@import "../vars";

.xdh-slide-panel {
  margin-bottom: 0;
  position: absolute;
  z-index: $--index-popper;
  transition: transform 0.2s;
  &__modal {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: $--color-black;
    opacity: 0.3;
    width: 100%;
    height: 100%;
    z-index: $--index-popper - 1;
  }
  &__wrapper {
    position: relative;
    overflow: hidden;
  }
  &.is-right {
    height: 100%;
    top: 50%;
    right: 0;
    transform: translate(0, -50%);
    &.is-collapsed {
      transform: translate(100%, -50%);
    }

    .xdh-slide-panel__handle {
      width: 15px;
      height: 60px;
      line-height: 60px;
      border-radius: $--border-radius-base 0 0 $--border-radius-base;
      left: 0;
      top: 50%;
      transform: translate(-100%, -50%);
    }
  }
  &.is-left {
    height: 100%;
    left: 0;
    top: 50%;
    transform: translate(0, -50%);
    &.is-collapsed {
      transform: translate(-100%, -50%);
    }

    .xdh-slide-panel__handle {
      width: 15px;
      height: 60px;
      line-height: 60px;
      border-radius: 0 $--border-radius-base $--border-radius-base 0;
      right: 0;
      top: 50%;
      transform: translate(100%, -50%);
    }
  }

  &.is-top {
    width: 100%;
    left: 50%;
    top: 0;
    transform: translate(-50%, 0);
    &.is-collapsed {
      transform: translate(-50%, -100%);
    }

    .xdh-slide-panel__handle {
      width: 60px;
      height: 15px;
      line-height: 15px;
      border-radius: 0 0 $--border-radius-base $--border-radius-base;
      bottom: 0;
      left: 50%;
      transform: translate(-50%, 100%);
    }
  }
  &.is-bottom {
    width: 100%;
    left: 50%;
    bottom: 0;
    transform: translate(-50%, 0);
    &.is-collapsed {
      transform: translate(-50%, 100%);
    }

    .xdh-slide-panel__handle {
      width: 60px;
      height: 15px;
      line-height: 15px;
      border-radius: $--border-radius-base $--border-radius-base 0 0;
      top: 0;
      left: 50%;
      transform: translate(-50%, -100%);
    }
  }

  &__handle {
    position: absolute;
    background: $--color-primary-light-8;
    text-align: center;
    cursor: pointer;
    color: $--color-info;
    &:hover {
      background: $--color-primary-light-9;
    }
  }
  &__inner {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: auto;
    left: 0;
    top: 0;
  }
}

.xdh-slide-panel.is-dark {
  &.xdh-panel {
    color: #eee;
    background: rgba(0, 0, 0, .8);
    border-color: rgba(0, 0, 0, .9);
  }
  .xdh-title__wrapper {
    background: rgba(0, 0, 0, .8);
  }
  .xdh-title__content {
    color: #fff;
  }
  .xdh-slide-panel__handle {
    background: rgba(0, 0, 0, .5);
    color: #fff;
    &:hover {
      background: rgba(0, 0, 0, .9);
    }
  }
}
